<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNewsXDemandTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //资讯关联的需求
        Schema::create('news_x_demand',function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer('news_id')->comment('用户id');
            $table->integer('demand_id')->comment('需求id');
            $table->softDeletes();
            $table->timestamps();
        });

        Schema::table('news',function (Blueprint $table)
        {
//            if (Schema::hasColumn('news', 'link_demand_id')) {
//                $table->dropColumn('link_demand_id');
//            }
            $table->integer('industry_id')->comment('行业id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
